LearningStoreHelper.CastNonNull<T> Method (object, out T)

Converts a value returned from a LearningStore query to a given type. Throws an exception if the value is DBNull.

Parent Type: LearningStoreHelper

Namespace: Microsoft.SharePointLearningKit

Assembly: Microsoft.SharePointLearningKit.dll

Syntax
C#

public static void CastNonNull<T> (
object value,
out T result

)

where T : struct

Type Parameters

T

The type to convert to.

Parameters

value

A value from a DataRow within a DataTable returned from a LearningStore query.

result

Where to store the result. value is cast to the type of result, or is set to null if value is DBNull.

Remarks

This version of Cast is used to retrieve a value type from LearningStore, i.e. bool, DateTime, float, double, Guid, int, or an enumerated type, when you know that the input value will not be the database "NULL" value. (If it is, an exception is thrown.)